//
//  YHYSearchCollectionViewCell.m
//  LANGirl
//
//  Created by 杨泓晔 on 16/3/30.
//
//

#import "YHYSearchCollectionViewCell.h"

@interface YHYSearchCollectionViewCell ()

@end

@implementation YHYSearchCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatView];
    }
    return self;
}
- (void)creatView{
     _textL = [UILabel new];
    [self.contentView addSubview:_textL];
    [self.contentView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0);
        make.height.mas_equalTo(self.contentView.frame.size.height);
        make.width.mas_equalTo(self.sizeWH.width+ 0 * AUTO_WIDTH);
        make.left.mas_equalTo(0);

        
    }];
  
    [_textL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0);
        make.height.mas_equalTo(self.contentView.frame.size.height);
        make.width.mas_equalTo(self.sizeWH.width+ 5 * AUTO_WIDTH);
        // make.right.mas_equalTo
        make.left.mas_equalTo(0);

        
    }   ];
    _textL.backgroundColor = LV;
    _textL.font = [UIFont fontWithName:@"Arial" size:TEXTCONTENTFONT2 * AUTO_WIDTH];
    _textL.textColor = TextGrayColor;
    //裁掉边框
    self.textL.layer.masksToBounds = YES;
    //设置半径
    self.textL.layer.cornerRadius = 6 *AUTO_HEIGHT;
    self.textL.layer.borderColor = KH.CGColor;
    self.textL.layer.borderWidth = 0.7 * AUTO_WIDTH;
    self.textL.textAlignment = NSTextAlignmentCenter;
    
}

- (void)setSizeWH:(CGSize)sizeWH{
    [_textL mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0);
        make.height.mas_equalTo(self.contentView.frame.size.height);
        make.width.mas_equalTo(sizeWH.width+ 7 * AUTO_WIDTH);
       
        make.left.mas_equalTo(0);
        
    }];

}
@end
